<?php

/**
 * Application Models
 *
 * @package Application_Model
 * @subpackage Model
 * @author <YOUR NAME HERE>
 * @copyright ZF model generator
 * @license http://framework.zend.com/license/new-bsd     New BSD License
 */

/**
 * Abstract class for models
 */
require_once 'ModelAbstract.php';

/**
 * 
 *
 * @package Application_Model
 * @subpackage Model
 * @author <YOUR NAME HERE>
 */
class Application_Model_Langue extends Application_Model_ModelAbstract
{

    /**
     * Database var type varchar(45)
     *
     * @var string
     */
    protected $_IdLANGUE;



    /**
     * Dependent relation fk_PILOT_NAMECOLUMN_LANGUE1
     * Type: One-to-Many relationship
     *
     * @var Application_Model_PilotNamecolumn
     */
    protected $_PilotNamecolumn;

    /**
     * Sets up column and relationship lists
     */
    public function __construct()
    {
        parent::init();
        $this->setColumnsList(array(
            'idLANGUE'=>'IdLANGUE',
        ));

        $this->setParentList(array(
        ));

        $this->setDependentList(array(
            'FkPILOTNAMECOLUMNLANGUE1' => array(
                    'property' => 'PilotNamecolumn',
                    'table_name' => 'PilotNamecolumn',
                ),
        ));
    }

    /**
     * Sets column idLANGUE
     *
     * @param string $data
     * @return Application_Model_Langue
     */
    public function setIdLANGUE($data)
    {
        $this->_IdLANGUE = $data;
        return $this;
    }

    /**
     * Gets column idLANGUE
     *
     * @return string
     */
    public function getIdLANGUE()
    {
        return $this->_IdLANGUE;
    }

    /**
     * Sets dependent relations fk_PILOT_NAMECOLUMN_LANGUE1
     *
     * @param array $data An array of Application_Model_PilotNamecolumn
     * @return Application_Model_Langue
     */
    public function setPilotNamecolumn(array $data)
    {
        $this->_PilotNamecolumn = array();

        foreach ($data as $object) {
            $this->addPilotNamecolumn($object);
        }

        return $this;
    }

    /**
     * Sets dependent relations fk_PILOT_NAMECOLUMN_LANGUE1
     *
     * @param Application_Model_PilotNamecolumn $data
     * @return Application_Model_Langue
     */
    public function addPilotNamecolumn(Application_Model_PilotNamecolumn $data)
    {
        $this->_PilotNamecolumn[] = $data;
        return $this;
    }

    /**
     * Gets dependent fk_PILOT_NAMECOLUMN_LANGUE1
     *
     * @param boolean $load Load the object if it is not already
     * @return array The array of Application_Model_PilotNamecolumn
     */
    public function getPilotNamecolumn($load = true)
    {
        if ($this->_PilotNamecolumn === null && $load) {
            $this->getMapper()->loadRelated('FkPILOTNAMECOLUMNLANGUE1', $this);
        }

        return $this->_PilotNamecolumn;
    }

    /**
     * Returns the mapper class for this model
     *
     * @return Application_Model_Mapper_Langue
     */
    public function getMapper()
    {
        if ($this->_mapper === null) {
            $this->setMapper(new Application_Model_Mapper_Langue());
        }

        return $this->_mapper;
    }

    /**
     * Deletes current row by deleting the row that matches the primary key
     *
	 * @see Application_Model_Mapper_Langue::delete
     * @return int|boolean Number of rows deleted or boolean if doing soft delete
     */
    public function deleteRowByPrimaryKey()
    {
        if ($this->getIdLANGUE() === null) {
            throw new Exception('Primary Key does not contain a value');
        }

        return $this->getMapper()
                    ->getDbTable()
                    ->delete('idLANGUE = ' .
                             $this->getMapper()
                                  ->getDbTable()
                                  ->getAdapter()
                                  ->quote($this->getIdLANGUE()));
    }
}
